﻿using static DesignModeConsole.创建型.建造者模式.ResourcePoolConfig2;

namespace DesignModeConsole.创建型.建造者模式;

public class BuilderService : IService
{
    public void Main()
    {
        //var resourcePoolConfig = new ResourcePoolConfig("db", null, null, null);

        //var resourcePoolConfig = new ResourcePoolConfig("db");
        //resourcePoolConfig.SetMaxTotal(5);
        //resourcePoolConfig.SetMaxIdle(5);

        //在build的时候会进行校验参数
        var resourcePoolConfig = new ResourcePoolConfigBuilder("postsql")
            .SetMaxTotal(5)
            .SetMaxIdle(6)
            .SetMinIdle(-1)
            .Build();
    }
}